Drupal Sections Module XSS Vulnerability

Է:

@Sebug.net   dis
վṩ()ܴй,ȫоѧ֮,Ը!1.The text of this announcment is also available at2.http://www.madirish.net/?article=4403. 4.Description of Vulnerability:5.- - - -----------------------------6.Drupal (http://drupal.org) is a robust content management system (CMS)7.written in PHP and MySQL that provides extensibility through various8.third party modules.  The Sections module9.(http://drupal.org/project/sections) "allows you to create sections10.within your site. Each section has an installed template, theme or style11.attached to it."12. 13.The Sections module contains a cross site scripting vulnerability14.because it does not properly sanitize output of section names before15.display.16. 17.Systems affected:18.- - - -----------------19.Drupal 6.14 with Sections 6.x-1.2 was tested and shown to be vulnerable.20. 21.Impact:22.- - - -------23.XSS vulnerabilities may expose site administrative accounts to24.compromise which could lead to web server process compromise.25. 26.Mitigating factors:27.- - - -------------------28.The Sections module must be installed.  To carry out a Sections based29.XSS proof of concept exploit below the attacker must have 'administer30.sections' permissions.31. 32.Proof of Concept:33.- - ---------------------34.1.  Install Drupal 6.1435.2.  Install Sections 6.x-1.236.3.  Enable the Sections module from Administer -> Site building -> Modules37.4.  Click Administer -> Site building -> Sections38.5.  Click the 'Add section' button39.5.  Enter "<script>alert('xss');</script>" in the 'Name' text area40.6.  Click the 'Add section' button to save the section and observe the41.rendered JavaScript42.7.  Click on the 'Sections' link in the navigation to observe the43.rendered JavaScript44. 45.Technical details:46.- - ------------------------47.The Sections module fails to sanitize the output of the section name48.before display.  Applying the following patch fixes this vulnerability.49. 50.Patch51.- - -------52.Applying the following patch mitigates these threats.53. 54.- --- sections/sections.admin.inc 2008-06-01 08:51:51.000000000 -040055.+++ sections.fixed/sections.admin.inc   2009-11-06 15:43:53.997416137 -050056.@@ -234,6 +234,7 @@ function theme_sections_admin_display_fo57.   foreach (element_children($form['sections']) as $key => $id) {58.     // Don't take form control structures.59.     if (is_array($form['sections'][$id]['name'])) {60.+      $form['sections'][$id]['name']['#value'] =61.filter_xss($form['sections'][$id]['name']['#value']);62.       $form['sections'][$id]['weight']['#attributes']['class'] =63.'sections-order-weight';64.       $rows[] = array(65.         'data' => array(66. 67. 68.Vendor Response69.- ---------------70.Upgrade to the latest version.71.SA-CONTRIB-2009-112 http://drupal.org/node/66140472. 73.- -- 74.Justin C. Klein Keane75.http://www.MadIrish.net